package Controller;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 * implements action on close
 * @author Vincent Francolin
 * @version 1.0 : creation
 */
public class OnCloseEvent extends WindowAdapter {
	ContactController cc;
	
	/**
	 * default constructor
	 * @param cc main controller of the application
	 */
	public OnCloseEvent(ContactController cc) {
		super();
		this.cc = cc;
	}

	/**
	 * method called when the window is closing
	 */
	public void windowClosing(WindowEvent e) {
		System.out.println("debug ");
		cc.saveContextBeforeExit();
		
	}
}
